<html>
<head>
    <title>文档</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="//cdn.staticfile.org/highlight.js/10.0.3/styles/monokai-sublime.min.css">
    <?php include 'style.html'?>
</head>

<body>
<div class="container target-menu">
    <div class="min-menu"><img src=""></div>
    <div class="menu">
        <div class="lsm-container">
            <div class="lsm-scroll">
                <div class="lsm-sidebar">
                    <ul class="app-menu-list" id="app-target-main">
                        <?php foreach($data as $k => $v): ?>
                        <li class="lsm-sidebar-item">
                            <a href="javascript:;"><span><img src=""><?=$v['title'] ?></span><i class="symbol sidebar-more"></i></a>
                            <ul>
                                <?php foreach($v['api'] as $vv): ?>
                                <li><a class="frame-info" data-frame="#wiki-<?=$v['title'] ?>-<?=$vv['title']?>" href="javascript:;">
                                    <span>
                                        <img src="">
                                        <?=$vv['title']?>
                                    </span>
                                </a></li>
                                <?php endforeach; ?>
                            </ul>
                        </li>
                        <?php endforeach; ?>
                        <li class="lsm-sidebar-item">
                            <a href="javascript:;"><span><img src="">公共</span><i class="symbol sidebar-more"></i></a>
                            <ul>
                                <li><a class="frame-info" data-frame="#wiki-公共-Mock" href="javascript:;">
                                    <span><img src="">Mock</span>
                                </a></li>
                            </ul>
                        </li>
                    </ul>
                </div>
            </div>
        </div>
    </div>

    <div class="frame">
        <?php foreach($data as $v): ?>
        <?php foreach($v['api'] as $vv): ?>

        <div id="wiki-<?=$v['title']?>-<?=$vv['title']?>" class="hide frame-list">
            <div class="title"><?=$vv['title']?></div>

            <div class="label-title">描述：</div>
            <div class="info"><?=$vv['description']?></div>

            <div class="label-title">URL：</div>
            <div class="info"><button class="btn btn-min"><?=$vv['method']?></button> /<?=$vv['rule']?></div>

            <div class="label-title">请求参数：</div>
            <div class="info">
                <div class="table-box">
                    <table class="table" cellspacing="0">
                        <?php include 'thead.html' ?>
                        <tbody>
                        <?php foreach($vv['mock']['request'] as $f): ?>
                        <tr>
                            <td><?=$f["field"]?></td>
                            <td><?=$f["title"]?></td>
                            <td><?=$f["type"]?></td>
                            <td><?=$f['require'] ? "√" : ""?></td>
                            <td><?=$f["example"]?></td>
                            <td><?=$f["description"]?></td>
                        </tr>
                        <?php endforeach; ?>
                        </tbody>
                    </table>
                </div>
            </div>

            <?php if($vv['mock']['request_ext'] ?? false): ?>
            <?php foreach($vv['mock']['request_ext'] as $ext_key => $ext_val): ?>

            <div class="label-title">请求参数[<?=$ext_key?>]：</div>
            <div class="info">
                <div class="table-box">
                    <table class="table" cellspacing="0">
                        <?php include 'thead.html' ?>
                        <tbody>

                        <?php foreach($ext_val as $ext): ?>
                        <tr>
                            <td><?=$ext["field"]?></td>
                            <td><?=$ext["title"]?></td>
                            <td><?=$ext["type"]?></td>
                            <td><?=$ext['require'] ? "√" : ""?></td>
                            <td><?=$ext["example"]?></td>
                            <td><?=$ext["description"]?></td>
                        </tr>
                        <?php endforeach; ?>
                        </tbody>
                    </table>
                </div>
            </div>
            <?php endforeach; ?>
            <?php endif; ?>

            <div class="label-title">返回参数:</div>
            <div class="info">
                <div class="table-box">
                    <table class="table">
                        <?php include 'thead.html' ?>
                        <tbody>
                        <?php foreach($vv['mock']['response'] as $f): ?>
                        <tr>
                            <td><?=$f["field"]?></td>
                            <td><?=$f["title"]?></td>
                            <td><?=$f["type"]?></td>
                            <td><?=$f['require'] ? "√" : ""?></td>
                            <td><?=$f["example"]?></td>
                            <td><?=$f["description"]?></td>
                        </tr>
                        <?php endforeach; ?>
                        </tbody>
                    </table>
                </div>
            </div>

            <?php if($vv['mock']['response_ext'] ?? false) : ?>
            <?php foreach($vv['mock']['response_ext'] as $ext_key => $ext_val): ?>
            <div class="label-title">返回参数[<?=$ext_key?>]：</div>
            <div class="info">
                <div class="table-box">
                    <table class="table" cellspacing="0">
                        <?php include 'thead.html' ?>
                        <tbody>
                        <?php foreach($ext_val as $ext): ?>
                        <tr>
                            <td><?=$ext["field"]?></td>
                            <td><?=$ext["title"]?></td>
                            <td><?=$ext["type"]?></td>
                            <td><?=$ext['require'] ? "√" : ""?></td>
                            <td><?=$ext["example"]?></td>
                            <td><?=$ext["description"]?></td>
                        </tr>
                        <?php endforeach; ?>
                        </tbody>
                    </table>
                </div>
            </div>
            <?php endforeach; ?>
            <?php endif; ?>

        </div>

        <?php endforeach; ?>
        <?php endforeach; ?>

        <div id="wiki-公共-Mock" class="hide frame-list">
            <?php include 'mock.html' ?>
        </div>
    </div>

    <div class="fixed">
        <p class="go-top"><img src=""></p>
    </div>

</div>

<script src="//cdn.staticfile.org/jquery/3.4.1/jquery.min.js"></script>
<script src="//cdn.staticfile.org/jQuery-slimScroll/1.3.8/jquery.slimscroll.min.js"></script>
<script type="text/javascript" src="//cdn.staticfile.org/highlight.js/10.0.3/highlight.min.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
<?php include 'script.html' ?>

</body>
</html>